package com.nchu.commondevelopmentframework.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nchu.commondevelopmentframework.entity.Role;
import com.nchu.commondevelopmentframework.mapper.RoleMapper;
import com.nchu.commondevelopmentframework.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @className: RoleServiceImpl
 * @description: 角色实体Service实现类
 * @author: Li Chuanwei
 * @date: 2024/02/24 20:26
 * @Company: Copyright [日期] by [作者或个人]
 **/
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService<Role> {
    @Autowired
    private RoleMapper roleMapper;

    /**
     * 获取全部角色
     *
     * @return 角色List
     */
    @Override
    public List<Role> selectAllRoles() {
        // 构建查询条件
        QueryWrapper<Role> queryWrapper = new QueryWrapper<>();
        // 可以根据实际需求添加查询条件，如果不需要条件，则无需添加
        return roleMapper.selectList(queryWrapper);
    }
}
